package com.openlab.callsystem.mapper;


import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.openlab.callsystem.entity.Caller;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.sql.ResultSet;
import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author cyq
 * @since 2021-11-14
 */
@Mapper
public interface CallerMapper extends BaseMapper<Caller> {
    @Select("select * from caller where account=#{account} and password=#{password} limit 1")
    public Caller isTrue(String account, String password);
    @Select("select * from caller")
    public List<Caller> queryAll();
    @Select("select * from caller where account=#{account} or name=#{name} or email=#{email}")
    public List<Caller> registerCheck(String account,String name,String email);
    @Insert("insert into Caller values(#{account},#{name},#{password},#{email},#{registerDate})")
    public void insertCaller(Caller caller);
    @Select("select count(*) from caller")
    public Integer calCallerNumber();
    public void deleteCaller(Integer id);
    public void updateCaller(Caller caller);
}
